package com.ycy.controller.employee;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ycy.pojo.Employee;
import com.ycy.pojo.Role;
import com.ycy.pojo.Wage;
import com.ycy.service.wage.WageService;

@Controller
public class WageController {
	@Autowired
	WageService service;
	@RequestMapping("/wage_list")
	public String roleList(HttpServletRequest request,Model m,HttpSession session){
		List<Wage> wages= service.findall();
		session.setAttribute("Wages",wages);
		return "wage_list";
	}
	@RequestMapping("/getWage")
	public String getRole(HttpServletRequest request,Model m,HttpSession session){
		Employee employee =(Employee) session.getAttribute("Me");
		String name =employee.getName();
		Wage wage= service.findIt(name);
		session.setAttribute("Wage",wage);
		return "wage_list";
	}
}
